package cn.minhx.lab.design_patterns.factory_method.f1;

import cn.minhx.lab.design_patterns.factory_method.f1.impl.HtmlDialog;
import cn.minhx.lab.design_patterns.factory_method.f1.impl.WindowsDialog;

/**
 * @author merrick.peng
 */
public class DialogFactory {

    public static Dialog createDialog(String osName) {
        Dialog dialog;
        if (osName.toLowerCase().startsWith("windows")) {
            dialog = new WindowsDialog();
        } else {
            dialog = new HtmlDialog();
        }
        return dialog;
    }

}
